import {
  Request
} from './request.js'


// 启动图
const bannerList = () => Request({
  url: '/banner/list',
  method: 'get'
})

//登录
const login = (data) => Request({
  url: '/user/wxapp/login',
  method: 'get',
  data: {
    code: data
  }
})

// 宫格
const homeShopList = () => Request({
  url: '/shop/goods/category/all',
  method: 'get'
})

// 商品列表
const homeShoppList = (data) => Request({
  url: '/shop/goods/list/v2',
  method: 'post',
  data
})

//分类列表
const itemList = (data) => Request({
  url: '/shop/goods/category/all',
  method: 'post'
})

//商品详情
const shoppDetails = (data) => Request({
  url: '/shop/goods/detail',
  method: 'get',
  data: {
    id: data.id,
    token: data.token
  }
})
//加入购物车
const shopcar = (data) => Request({
  url: '/shopping-cart/add',
  method: 'post',
  data: {
    id: data.id,
    token: data.token
  }
})

export {
  bannerList,
  homeShopList,
  homeShoppList,
  itemList,
  shoppDetails,
  login,
  shopcar
}